#ifndef __OZI_API
#define __OZI_API

#if defined(USE_OZI_IMP)
  #define OZII extern "C"
  #define OZIF( v ) WINAPI v
#else
  #define OZII typedef
  #define OZIF( v ) (CALLBACK* T##v)
#endif

#define OZ_GRID_UTM           1 // 1=UTM
#define OZ_GRID_TM            2 // 2=Transverse Mercator (user grid)
#define OZ_GRID_BRITISH       3 // 3=British National grid (BNG,OSGB)
#define OZ_GRID_IRISH         4 // 4=Irish Grid
#define OZ_GRID_NEWZELAND     5 // 5=New Zealand Grid
#define OZ_GRID_SWEDISH       6 // 6=Swedish Grid
#define OZ_GRID_SWISS         7 // 7=Swiss Grid
#define OZ_GRID_FRANCE1       8 // 8=France I
#define OZ_GRID_FRANCE2       9 // 9=France II
#define OZ_GRID_FRANCE3       10// 10=France III
#define OZ_GRID_FRANCE4       11// 11=France IV
#define OZ_GRID_ITALY1        12// 12=Italy 1 Grid
#define OZ_GRID_ITALY2        13// 13=Italy 2 Grid
#define OZ_GRID_VICMAP        14// 14=Vicmap TM Grid

OZII int OZIF( oziCloseApi )( void );

OZII int OZIF( oziGetExePath )(char **, int *);

OZII int OZIF( oziCenterMapAtPosition )(double, double);
OZII int OZIF( oziCenterMapAtPositionWithMark )(double, double);
OZII int OZIF( oziCloseProgram )(void);
OZII int OZIF( oziFindOzi )(void);
OZII int OZIF( oziGetMapFilePath)(char **);
OZII int OZIF( oziGetMapDatum )(char * &Datum, int &DataLength);
OZII int OZIF( oziConvertLL2Grid)( int GridNumber, double lat, double lon,
                                   char *&Datum, char *&Zone,
                                   double &Easting, double &Northing,
                                   double Lat0, double Lon0, double Lat1, double Lat2, double K0, double X0, double Y0 );

OZII int OZIF( oziConvertDatum )(char **, char **, double *, double *);

OZII int OZIF( oziStopMM )(void);
OZII int OZIF( oziStartMMserial )(void);
OZII int OZIF( oziStartMMapi )(void);
OZII int OZIF( oziSendMMstring )( const char *s );
OZII int OZIF( oziClearWPs )(void);
OZII int OZIF( oziClearEVs )(void);
OZII int OZIF( oziClearRTEs )(void);
OZII int OZIF( oziClearTRKs )(void);
OZII int OZIF( oziClearTRK )(int);
OZII int OZIF( oziClearPTs )(void);
OZII int OZIF( oziClearMFs )(void);
OZII int OZIF( oziClearMCs )(void);


OZII int OZIF( oziCreateWP )(char **, int ,double, double, double, double, int, int, int, int, int, int,
                                     char **, int, int, int);

OZII int OZIF( oziCreateMF )(char **, double, double, char **, char **, char **, int, char **);

OZII int OZIF( oziCreateMC )(char **, double, double, int, int, int, int , int, int);


OZII int OZIF( oziMapSingleClickON )(int *);
OZII int OZIF( oziMapSingleClickOFF )(void);
OZII int OZIF( oziMapDblClickON )(int *);
OZII int OZIF( oziMapDblClickOFF )(void);
OZII int OZIF( oziObjectClickON )(int *);
OZII int OZIF( oziObjectClickOFF )(void);

OZII int OZIF( oziLoadMap )(char **);
OZII int OZIF( oziSaveMap )(char **);
OZII int OZIF( oziLoadWPfile )(char **);
OZII int OZIF( oziLoadTRKfile )(int, char **);

OZII int OZIF( oziChangeTRKcolor )(int, int);

// multi tracking
OZII int OZIF( oziMTStartMultiTrack )(void);
OZII int OZIF( oziMTStopMultiTrack )(void);
OZII int OZIF( oziMTSendPosition )(char **);
OZII int OZIF( oziMTloadIDsON )(void);
OZII int OZIF( oziMTloadIDsOFF )(void);

//MM
typedef void (WINAPI *TMMpositionCallback)(double Lat,double Lon,double speed,double heading,double magvar,double altitude);

OZII int OZIF( oziSendMMpositionON )( TMMpositionCallback cb );
OZII int OZIF( oziSendMMpositionOFF )( void );

//============================================================================
#if !defined(USE_OZI_IMP)
extern HINSTANCE oziApiDll;           // Handle to DLL

extern ToziCloseApi oziCloseApi;
extern ToziGetExePath oziGetExePath;

extern ToziCenterMapAtPosition oziCenterMapAtPosition;
extern ToziCenterMapAtPositionWithMark oziCenterMapAtPositionWithMark;
extern ToziCloseProgram oziCloseProgram;
extern ToziStartMMserial oziStartMMserial;
extern ToziFindOzi oziFindOzi;
extern ToziStopMM  oziStopMM;
extern ToziGetMapDatum oziGetMapDatum;
extern ToziStartMMapi oziStartMMapi;
extern ToziConvertLL2Grid oziConvertLL2Grid;

extern ToziConvertDatum oziConvertDatum;

extern ToziClearWPs oziClearWPs;
extern ToziClearEVs oziClearEVs;
extern ToziClearRTEs oziClearRTEs;
extern ToziClearTRKs oziClearTRKs;
extern ToziClearTRK oziClearTRK;
extern ToziClearPTs oziClearPTs;
extern ToziClearMFs oziClearMFs;
extern ToziClearMCs oziClearMCs;


extern ToziCreateWP oziCreateWP;
extern ToziCreateMF oziCreateMF;
extern ToziCreateMC oziCreateMC;

extern ToziMapSingleClickON oziMapSingleClickON;
extern ToziMapSingleClickOFF oziMapSingleClickOFF ;
extern ToziMapDblClickON oziMapDblClickON;
extern ToziMapDblClickOFF oziMapDblClickOFF;
extern ToziObjectClickON oziObjectClickON;
extern ToziObjectClickOFF oziObjectClickOFF;

extern ToziLoadMap oziLoadMap;
extern ToziSaveMap oziSaveMap;
extern ToziLoadWPfile oziLoadWPfile;
extern ToziLoadTRKfile oziLoadTRKfile;

extern ToziChangeTRKcolor oziChangeTRKcolor;

//these are for multi tracking
extern ToziMTStartMultiTrack oziMTStartMultiTrack;
extern ToziMTStopMultiTrack oziMTStopMultiTrack;
extern ToziMTSendPosition oziMTSendPosition;
extern ToziMTloadIDsON oziMTloadIDsON;
extern ToziMTloadIDsOFF oziMTloadIDsOFF;

//MM
extern ToziSendMMpositionON oziSendMMpositionON;
extern ToziSendMMpositionOFF oziSendMMpositionOFF;

BOOL LoadOziApiDll(void);
#endif

#endif /* _oziapi_h_ */
